function closeconfrim(){
	$(".js_close").attr("style","display:none;");
}
function updatehtml(){
		window.location.href = "index.html";
}

function uploadmusic() {
	// alert($(".js_confirmVlue").attr());
	if($(".js_fileinput").val() != ""){
		$(".uploding_button").css("background-color","#b1b1b1");
		$(".uploding_button").attr("disabled",true);
		$(".uploding_button").attr("value","正在上传...");
		formData = new FormData(document.getElementById('formid'));
		$.ajax({
			url: "music/upload/uploadandsave",
			type: "post",
			data: formData,
			dataType: "json",
			// async: false, //参数设置异步或同步请求，默认为true同步,返回数据后才能继续操作，这样才能先修改样式
			cache: false,
			processData: false,
			contentType: false,
			success: function (data) {
				var info = data.info;
				var result = "";
				if (info == 0) {
					//上传成功
					result = "上传成功";
					$(".js_uploadConfirmTip").html(result);
					$(".js_uploadconfirm").attr("style","display:inline;");
				} else {
					result = "上传文件失败";
					if (data.already == 1) {
						//上传失败，库中已有相同歌曲信息
						result = "库中已有相同歌曲，请重新上传";
						$(".js_uploadConfirmTip").html(result);
						$(".js_uploadconfirm").attr("style","display:inline;");
					}
					//上传失败
					$(".js_uploadConfirmTip").html(result);
					$(".js_uploadconfirm").attr("style","display:inline;");
				}

			},
			error: function (XMLHttpRequest, textStatus, errorThrown) {
				// alert(XMLHttpRequest.status);
				// alert(textStatus.readyState);
				// alert(textStatus);
				$(".js_uploadConfirmTip").html("上传文件失败");
				$(".js_uploadconfirm").attr("style","display:inline;");
			}
		});
	} else {
		$(".js_nullTip").html("请选择上传歌曲~");
		$(".js_close").attr("style","display:inline;");
	}

}
